<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<#include "head.html">
<title>添加</title>
</head>
<body>
<article class="page-container">
	<form action="${contextPath}/sys/menu/save.do" method="post" class="form form-horizontal" id="form">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">上级：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<span class="select-box">
					<select class="select"  name="pid">
						<option></option>
						<#if treeMenus??>
							<#list treeMenus as vo>
								<option  <#if entity.pid?? &&entity.pid == vo.sysMenu.id >selected</#if> value="${(vo.sysMenu.id)!}">${(vo.sysMenu.menuName)!}</option>
								<#if vo.children?? && (vo.children?size > 0)>
									<#list vo.children as ch>
										<option <#if entity.pid?? &&entity.pid == ch.sysMenu.id >selected</#if> value="${(ch.sysMenu.id)!}">&nbsp;&nbsp;├ ${(ch.sysMenu.menuName)!}</option>
									</#list>
								</#if>
							</#list>
						</#if>
					</select>
				</span>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>菜单名称：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" required value="${entity.menuName}" name="menuName">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>菜单code：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" required value="${entity.code}" name="code">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>类型：</label>
			<div class="formControls col-xs-8 col-sm-9 skin-minimal">
				<div class="radio-box">
					<input type="radio" value="1" id="radio-1" name="type" checked>
					<label for="radio-1">菜单</label>
				</div>
				<div class="radio-box">
					<input type="radio" value="2" id="radio-2" name="type" <#if entity.type??&&entity.type==2>checked</#if> >
					<label for="radio-2">按钮</label>
				</div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">排序：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="${entity.sort}" name="sort">
			</div>
		</div>


		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">跳转地址：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="${entity.url}" name="url">
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
		</div>
		<input type="hidden" value="${entity.id}" name="id">
	</form>
</article>

<#include "footer.html">

<!--请在下方写此页面业务相关的脚本--> 
<script type="text/javascript">
$(function(){
    $('.skin-minimal input').iCheck({
        checkboxClass: 'icheckbox-blue',
        radioClass: 'iradio-blue',
        increaseArea: '20%'
    })

	$("#form").validate({
		rules:{
		},
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			var options = {  
					url:$("#form").attr("action"),
	                success: function() {
	                	layer.alert('操作成功', function(index){
	  	                	var index = parent.layer.getFrameIndex(window.name);
	  	        			parent.$("[name='refresh']").click();
	  	        			parent.layer.close(index);
	                	});    
	                	
	                }   
	        }; 
			$(form).ajaxSubmit(options);
		}
	});
});
</script> 
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>